<extend name="Public/base"/>
<link rel="stylesheet" type="text/css" href="__ZUI__/lib/datetimepicker/datetimepicker.css" media="all">
<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$meta_title}{$recycle}</h2>
    </div>
        <div class="search-form  col-xs-2 text-right" style="float: right;margin-bottom: 8px;">
            <div class="input-group">
                <input type="text" name="keyword2" class="search-input form-control" value="{:I('keyword2')}" placeholder="订单名称/订单号">
                <span class="input-group-btn">  <a class="btn btn-default" href="javascript:;" id="search" url="{:U('order')}"><i class="icon-search"></i></a></span>
            </div>
        </div>
        <form action="{:U(order)}" method="post">

             <div class="form-item cf" >
                        <label class="item-label">选择单位：</label>
                        <div class="controls">
                            <select name="type" data-role="select_text" class="form-control" style="width:25%;">
                                <option value="0">请选择</option>
                                <volist name="typeList" id="vo">
                                <option value="{$vo.id}" <if condition="$data.type eq 1">selected</if> >{$vo.title}</option>                               
                                </volist>
                            </select>
                        </div>
                </div>
            <h5>按状态统计：</h5>
            <div class="form-group">
                <div class="col-sm-3">
                    <select name="keyword1" class="form-control select">
                        <option value="1">已缴费</option>
                        <option value="2">未缴费</option>
                        
                    </select>
                </div>

            </div>
            <div style="clear:both;"></div>
            <h5>按创建时间统计（开始时间 — 结束时间）：</h5>


            <div class="form-group">

                <div class="col-sm-3">

                    <input type="text" class="form-control form-datetime form-control " placeholder="选择或者输入一个日期+时间：yyyy-MM-dd hh:mm" name="start" value="2017-01-01 00:00" readonly="">

                </div>

                

                <div class="col-sm-3">

                    <input type="text" class="form-control form-datetime form-control " placeholder="选择或者输入一个日期+时间：yyyy-MM-dd hh:mm" name="end" value="2017-12-31 00:00" readonly="">

                </div>
                
            </div>
            <div style="clear:both;"></div>
            <div class="form-group" style="    padding: 20px 10px;">
                <input type="submit" value="查询" class="btn submit-btn">
            </div>
        </form>
            <div class="panel-body ">
                <h5 style="color:red;" >{$statustitle} 总计{$totalCount}条。</h5>
            </div>
         
    <!-- 数据列表 -->
    <div class="data-table with-padding">
        <table class="table table-bordered table-striped ">
            <thead>
            <tr>
                <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                <th class="">id</th>
                <th class="">单位ID</th>
                <th class="">账单ID</th>
                <th class="">订单号</th>
                <th class="">订单名称</th>
                <th class="">订单详情</th>
                <th class="">订单金额</th>
                <th class="">订单状态</th>
                <th class="">创建时间</th>
                <th class="">更新时间</th>
             </tr>
            </thead>
            
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.unit}</td>
                        <td>{$vo.bill_id}</td>
                        <td>{$vo.order_id}</td>
                        <td>{$vo.order_name}</td>
                        <td>{$vo.order_detail}</td>
                        <td>{$vo.amount}</td>
                           <td>
                            <if condition="$vo.status eq 1">
                                <span style="color:green;">已缴费</span>
                                <else/>
                                <span style="color:red;">未缴费</span>
                            </if>
                        </td>
                        <td>{$vo.create_time|time_format}</td>
                        <td>{$vo.update_time|time_format}</td>
                    </tr>
                </volist>
                <else/>
                <td colspan="10" class="text-center">{:L('_ADMIN_USER_EMPTY_')}</td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="with-padding">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__CSS__/status.css"></script>
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript" src="__STATIC__/qtip/jquery.qtip.min.js"></script>
    <script src="__ZUI__/lib/datetimepicker/datetimepicker.js"></script>
    <script type="text/javascript">
        // 选择时日期
        $(".form-datetime").datetimepicker({
            language: "zh-CN",
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            showMeridian: 1,
            format: "yyyy-mm-dd hh:ii"
        });
    </script>
    
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav('{:U('order')}');
    </script>
</block>